<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">
<h:head>
	<link rel="stylesheet" type="text/css" href="../template/css.css"
		media="all" />
	<title>QueroTeto</title>
</h:head>
<h:body>
	<div id="corpo">
		<ui:include src="/template/topo.xhtml" />
		<ui:include src="/template/menu.xhtml" />
		<div id="slide"></div>
		<div id="conteudo">
			<div id="centro">

				<!-- <p:dataTable value="#{imovelBean.list}" var="imovel" rendered="#{imovelBean.listaVazia != true}">
				
					 <p:column headerText="Rua">
						
						<h:outputText value="#{imovel.rua}" />
						
					</p:column>
					<p:column headerText="Bairro">
						
						<h:outputText value="#{imovel.bairro}" />
						
					</p:column>
					
					<p:column headerText="CEP">
						<h:outputText value="#{imovel.cep}" />
						
					</p:column>
				
				</p:dataTable> -->

				<h:form>
					<p:carousel rendered="#{imovelBean.listaVazia != true}"
						id="basicCarousel" value="#{imovelBean.list}" var="imovel"
						itemStyleClass="carItem" numVisible="2">
						<f:facet name="header">  
			            	Imóveis  
			    		</f:facet>
						<h:panelGrid columns="1" width="300px" cellpadding="2px"
							cellspacing="2px">

							<h:outputText value="#{imovel.cidade}" />
							<h:outputText value="#{imovel.bairro}" />
							<h:outputText value="#{imovel.valorAluguel}" />

							<h:outputText
								value="#{imovel.garagem?'Possui Garagem' : 'Não possui garagem'}" />

							<p:commandButton value="Detalhes"
								action="#{imovelBean.visualizarImovel}">
								<f:param name="id" value="#{imovel.idPk}" />
							</p:commandButton>
						</h:panelGrid>
					</p:carousel>
				</h:form>

				<h:outputText value="#{msg.imovel_pesquisa_vazia}"
					rendered="#{imovelBean.listaVazia}" />
			</div>
			<div id="direita" align="center">
				<h3>Pesquisa de Imóveis</h3>
				<h:form>
					
					<h:panelGrid columns="2"  >
					
						<p:outputLabel value="Cidade " for="cidade"/>
						<p:selectOneMenu value="#{imovelBean.imovel.cidade}" id="cidade" >
							 <f:selectItem itemLabel="Todas as Cidades" itemValue="" />  
            				 <f:selectItems value="#{imovelBean.dao.listCidades}" />
						</p:selectOneMenu>
						<p:outputLabel value="Quartos " for="quartos"/>
						<p:selectOneMenu value="#{imovelBean.imovel.qtdQuartos}" id="quartos">
							<f:selectItem itemLabel="Todos" itemValue="0" />
							<f:selectItem itemLabel="1" itemValue="1" />
							<f:selectItem itemLabel="2" itemValue="2" />
							<f:selectItem itemLabel="3" itemValue="3" />
							<f:selectItem itemLabel="4" itemValue="4" />
							<f:selectItem itemLabel="5" itemValue="5" />
							<f:selectItem itemLabel="6" itemValue="6" />
							<f:selectItem itemLabel="7" itemValue="7" />
							<f:selectItem itemLabel="8" itemValue="8" />
							<f:selectItem itemLabel="9" itemValue="9" />
						</p:selectOneMenu>
						<p:outputLabel value="Banheiros " for="banheiros" />
						<p:selectOneMenu value="#{imovelBean.imovel.qtdBanheiros}" id="banheiros">
							<f:selectItem itemLabel="Todos" itemValue="0" />
							<f:selectItem itemLabel="1" itemValue="1" />
							<f:selectItem itemLabel="2" itemValue="2" />
							<f:selectItem itemLabel="3" itemValue="3" />
							<f:selectItem itemLabel="4" itemValue="4" />
							<f:selectItem itemLabel="5" itemValue="5" />
							<f:selectItem itemLabel="6" itemValue="6" />
							<f:selectItem itemLabel="7" itemValue="7" />
							<f:selectItem itemLabel="8" itemValue="8" />
							<f:selectItem itemLabel="9" itemValue="9" />
						</p:selectOneMenu>
						<p:outputLabel value="Garagem " for="garagem" />
						<p:selectBooleanCheckbox id="garagem" value="#{imovelBean.imovel.garagem}" />
					</h:panelGrid>
					<br />
					<p:tooltip for="pesquisar" value="Campos de preenchimento não obrigatório para efetuar a pesquisa" showEffect="fade" hideEffect="fade" />
					<p:commandButton value="Pesquisar" action="#{imovelBean.pesquisaImovel}" id="pesquisar"/>
				</h:form>
				<br />
		</div>
		</div>
		<div id="both" align="center"></div>
		<ui:include src="/template/rodape.xhtml" />
	</div>
</h:body>
</html>